﻿using System;

namespace Netfraction.Common.DataStorage
{
    internal static class StorageDataSource
    {
        private static DataSource _dataSource;

        private static void CreateDataSource()
        {
            if (_dataSource != null)
                return;

            Version curVersion = System.Reflection.Assembly.GetEntryAssembly().GetName().Version;

            _dataSource = new DataSource();

            _dataSource.Name = "NetfractionStorage";
            _dataSource.Version = String.Format("{0}.{1}", curVersion.Major, curVersion.Minor);
            _dataSource.Guid = new Guid("92F34DC0-6745-4d44-8092-DE52F57D1BB2");
            _dataSource.Author = "darkKlor";
            _dataSource.SourceLicence = "GPL v2.0";
            _dataSource.UpdateUrl = "";
            _dataSource.SiteUrl = "http://netfraction.codeplex.com/";
        }

        public static DataSource DataSource
        {
            get
            {
                if (_dataSource == null)
                    CreateDataSource();

                return _dataSource;
            }
        }
    }
}
